package com.imooc.service;

import com.imooc.dataobject.OrderMaster;
import com.imooc.dto.OrderDTO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

/**
 * FileName: OrderService.java
 * Description: 订单服务类
 *
 * @author HuangRI(874668739 @ qq.com)
 * @version 1.0
 * @date 2020/12/17
 */
public interface OrderService {

    /**
     * 创建订单
     * @param orderDTO OrderDTO
     * @return OrderDTO
     */
    OrderDTO create(OrderDTO orderDTO);

    /**
     * 根据订单ID查询订单详情列表
     * @param orderId 订单ID
     * @return OrderDTO
     */
    OrderDTO findOne(String orderId);

    /**
     * 根据分页条件和买家openid查询订单列表
     * @param buyerOpenid 买家openid
     * @param pageable 分页条件
     * @return 订单列表分页结果
     */
    Page<OrderDTO> findList(String buyerOpenid, Pageable pageable);

    /**
     * 取消订单
     * @param orderDTO OrderDTO
     * @return OrderDTO
     */
    OrderDTO cancel(OrderDTO orderDTO);

    /**
     * 完结订单
     * @param orderDTO OrderDTO
     * @return OrderDTO
     */
    OrderDTO finish(OrderDTO orderDTO);

    /**
     * 支付订单
     * @param orderDTO OrderDTO
     * @return OrderDTO
     */
    OrderDTO paid(OrderDTO orderDTO);

    /**
     * 查询订单列表
     * @param pageable Pageable
     * @return Page<OrderDTO>
     */
    Page<OrderDTO> findList(Pageable pageable);
}
